<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>layout布局页面</title>
		<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js" ></script>
		<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js" ></script>
		<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css" />
		<link rel="stylesheet" href="../js/easyui/themes/icon.css" />
		<script type="text/javascript" src="../js/ztree/jquery.ztree.all-3.5.js" ></script>
		<link rel="stylesheet" type="text/css" href="../js/ztree/zTreeStyle.css" />
		<script type="text/javascript">
			$(function(){
				//1.进行ztree菜单设置
				var setting = {
					data:{
						simpleData:{
							enable:true//支持简单的json数据格式
						}
					},
					callback:{
						onClick(event, treeId, treeNode, clickFlag) {
							var content = '<div style="width:100%;height:100%;overflow:hidden;">'
								+ '<iframe src="'
								+ treeNode.page
								+ '" scrolling="auto" style="width:100%;height:100%;border:0;" ></iframe></div>';
								//没有page树形菜单不打开选项卡
								if(treeNode.page!=undefined && treeNode.page !=""){
									//如果选项卡打开  选中
									if($("#mytabs").tabs('exists',treeNode.name)){
										//选中选项卡
										$("#mytabs").tabs('select',treeNode.name);
									}else{
										//如果没有打开,添加选项卡
										$("#mytabs").tabs('add',{
											title:treeNode.name,
											content:content,
											closable:true
										});
									}
								}
						}
					}
				};
				//2.提供ztree树形菜单数据
				var zNode=[
					{id:1,pId:0,name:"父节点一"},
					{id:2,pId:0,name:"父节点二"},
					{id:3,pId:0,name:"父节点三"},
					{id:11,pId:1,name:"子节点一",page:"http://www.baidu.com"},
					{id:22,pId:2,name:"子节点二",page:"http://www.souhu.com"},
					{id:33,pId:3,name:"子节点三",page:"http://www.oldgrannytube.com"},
					{id:34,pId:3,name:"子节点四",page:"http://www.xinlang.com"}
				];
				//3.生成菜单
				$.fn.zTree.init($("#baseMenu"),setting,zNode);
				
				//对选项卡进行右击时间
				$("#mytabs").tabs({
					onContextMenu:function(e,title,indext){
						//阻止默认菜单显示
						e.preventDefault();
						//显示自定义右键菜单
					$("#mm").menu('show',{
						left:e.pageX,
						top:e.pageY
					});
					}
				});
				
				//右下角弹出窗口
				$.messager.show({
					title:"爸爸您来了",
					msg:"看羞羞,<a href='http://www.oldgrannytube.com'>请猛戳这里</a>",
					timeout:5000//5秒自动消失
				});
				
			});
			
		</script>
	</head>
	<body class="easyui-layout">
		<div data-options="region:'north',title:'传智播客管理系统' "style="height:80px;">
			<a href="#" class="easyui-menubutton" data-options="iconCls:'icon-save',menu:'#nn'">
				更换皮肤
			</a>
			<div id="nn" style="width: 120px;">
				<div>红</div>
				<div>黄</div>
				<div>绿</div>
				<div class="menu-sep"></div>
				<div>紫</div>
			</div>
		</div> 

		<div data-options="region:'west',title:'菜单导航'" style="width:180px;">
			<!--折叠模板-->
			<div class="easyui-accordion" data-options="fit:true">
				<div data-options="title:'基础功能'">
					<!--通过ztree插件   制作菜单-->
					<ul id="baseMenu" class="ztree"></ul>
				</div>
				<div data-options="title:'系统管理'">面板二</div>
			</div>
		</div> 

		<div data-options="region:'center'">
			<!--选项卡面板-->
			<div id="mytabs" class="easyui-tabs" data-options="fit:true">
			</div>
		</div> 

		<div data-options="region:'east'" style="width:80px;">东部区域</div> 

		<div data-options="region:'south'" style="height: 80px;">南部区域</div> 

		<!--菜单   初始化都是隐藏的   独立的div-->
		<div id="mm" class="easyui-menu" style="width: 120px;">
			<div>关闭当前窗口</div>
			<div>关闭其他窗口</div>
			<div class="menu-sep"></div>
			<div date-options="iconCls:'icon-cancel'">关闭全部窗口</div>
		</div>
	</body>
</html>